public class homework2_clock {
    public static class MyStopWatch{
        long startTime=-1;//启动时间
        long stoptime=-1;//停止时间
        int runningstate=0;//运行状态
        int splitstate=5;//是否分段
        public int start(){//启动
            System.out.println("启动");
            this.startTime=System.currentTimeMillis();
            return  this.runningstate=1;
        }
        public int stop(){//停止
            System.out.println("停止");
            this.stoptime=System.currentTimeMillis();
            this.gettime();
            return this.runningstate=2;
        }
        public int suspend(){//暂停
            System.out.println("暂停");
            return this.runningstate=3;
        }
        public int split(){
            long split=this.stoptime; 
            long sp=Math.round((this.getsplittime()-split)/1000)>>60;
            System.out.println("已经计时节点秒数"+this.getsplittime());
            System.out.println("间隔时间"+sp);
            return splitstate=4;
        }
        public int unsplit(){
            return splitstate=5;
        }
        public long getsplittime(){
            this.stoptime=System.currentTimeMillis();
            return this.stoptime;
        }
        public int resume(){
            return this.runningstate=1;
        }
        public long gettime(){
            return Math.round((this.stoptime-this.startTime)/1000)%60;
        }
        public static void main(String[] args) {
            MyStopWatch watch=new MyStopWatch();
            watch.start();
            watch.suspend();
            watch.split();
            watch.suspend();
            watch.split();
            watch.stop();

        }


    }
    
}
